package com.hornsun.repository.mapper;

import com.hornsun.domain.dbo.Commodity;
import com.hornsun.domain.dbo.CommodityExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Component;

@Component
public interface CommodityMapper {
    long countByExample(CommodityExample example);

    int deleteByExample(CommodityExample example);

    int deleteByPrimaryKey(String commodityGuid);

    int insert(Commodity record);

    int insertSelective(Commodity record);

    List<Commodity> selectByExampleWithRowbounds(CommodityExample example, RowBounds rowBounds);

    List<Commodity> selectByExample(CommodityExample example);

    Commodity selectByPrimaryKey(String commodityGuid);

    int updateByExampleSelective(@Param("record") Commodity record, @Param("example") CommodityExample example);

    int updateByExample(@Param("record") Commodity record, @Param("example") CommodityExample example);

    int updateByPrimaryKeySelective(Commodity record);

    int updateByPrimaryKey(Commodity record);

    //获取收藏的商品信息
    List<Commodity> getFavouriteCommodity(@Param("openid")String openid,@Param("offset")int offset);

    //收藏量+1
    void updateFavourite(String commodityGuid);
}